package com.edu.ahm.thread;

/**
 * 创建线程方式二 ：实现Runnable 接口，重写run方法， 调用start方法
 */
public class MyThread3 implements Runnable{

    @Override
    public void run() {
        for (int i=0;i<800;i++){
            System.out.println("子线程执行到了"+i );
        }
    }

    public static void main(String[] args) {

//        MyThread3 myThread3 = new MyThread3();
//
//        Thread thread = new Thread(myThread3);
//        thread.start();

        new Thread(new MyThread3()).start();

        for (int i=0;i<400;i++){
            System.out.println("主线程执行到了"+i);
        }
    }
}
